<?php

namespace app\admin\validate;
use think\Validate;

class Admin extends Validate {

    protected $rule = [
        'name' => 'require|unique:admin',
        'pwd' => 'require|confirm',
    ];

    protected $message = [
        'username.require' => '用户名不能为空',
        'username.unique' => '用户名不能重复',
        'password.require' => '密码不能为空',
        'password.confirm' => '两次密码不一致',
    ];

    protected $scene = [
        'edit' => [
            'username',
            'password' => 'confirm',
        ],
    ];

}